import request from '@/utils/request';

/**
 * 查询硬盘录像机列表
 *
 * @param cameraName 名称
 * @param deviceSerial 序列号
 * @param pageNum
 * @param pageSize
 */
export const getNVRList = (params: any) => request({
    url: '/system/safetyCamera/list',
    method: 'get',
    params,
});

/**
 * 添加硬盘录像机
 */
export const addNVR = (data: any) => request({
    url: '/system/safetyCamera',
    method: 'post',
    data,
});

/**
 * 修改硬盘录像机
 */
export const modifyNVR = (data: any) => request({
    url: '/system/safetyCamera',
    method: 'put',
    data,
});

/**
 * 删除硬盘录像机
 */
export const deleteNVR = (id: any) => request({
    url: `/system/safetyCamera/${id}`,
    method: 'delete',
});

/**
 * 获取萤石云授权码AccessToken
 *
 * @param appKey
 * @param appSecret
 */
export const getEZAccessToken = (params: any) => request({
    url: '/system/safetyCamera/getAccessToken',
    method: 'get',
    params,
});

/**
 * 获取该萤石云设备下的萤石云播放设备信息列表
 *
 * @param accessToken
 * @param deviceSerial
 * @param pageNum
 * @param pageSize
 */
export const getCameraList = (params: any) => request({
    url: '/system/safetyCamera/cameraListPage',
    method: 'get',
    params,
});
